package com.leyou.user.inter.pojo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @数表名称 tb_permission
 * @开发日期 2020-03-24
 */
@Data
@Table(name="tb_permission")
@NoArgsConstructor
public class Permission implements Serializable {
    
    /** 主键id (主健ID) */
    @Id
    @Column(name="id")
    private Long id;

    /** 创建时间 */
    @Column(name="create_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createDate;

    /** 修改时间 */
    @Column(name="update_date")
    private Date updateDate;

    /** 是否启用：0/否 1/启用  (默认值为: 0) */
    @Column(name="is_enable")
    private Boolean isEnable;

    /** 权限排序 */
    @Column(name="sort")
    private Integer sort;

    /** 上级权限id */
    @Column(name="parent_id")
    private Long parentId;

    /** 是否为父节点，0为否，1为是 */
    @Column(name="is_parent")
    private Boolean isParent;

    /** 菜单权限图标 */
    @Column(name="icon")
    private String icon;

    /** 权限名称 */
    @Column(name="name")
    private String name;

    /** 权限请求方式：如GET/POST/PUT/DELETE */
    @Column(name="method")
    private String method;

    /** 权限路径 */
    @Column(name="url")
    private String url;

    /** 权限类型：1/一级菜单 2/二级菜单 3/其他 */
    @Column(name="type")
    private Integer type;

    private List<Permission> list;

    public Permission(Long id, Date updateDate, Boolean isParent) {
        this.id = id;
        this.updateDate = updateDate;
        this.isParent = isParent;
    }

    private static final long serialVersionUID = 1L;
}